﻿using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MSA.SocialNetworking
{
    class msa_ErrorReporter
    {
        public static void Log(string _event, Exception _e, string _module, string _method)
        {
            string sSource = "MSA.SocialNetworking";
			string sLog = "Application";
			string sEvent = _event;
            byte[] edetail = Encoding.ASCII.GetBytes(_e.Message + Environment.NewLine + _e.InnerException.Message);
			if (!EventLog.SourceExists(sSource))
				EventLog.CreateEventSource(sSource,sLog);

			EventLog.WriteEntry(sSource,sEvent);
			EventLog.WriteEntry(sSource, sEvent, EventLogEntryType.Error, 234, 1, edetail);
        }
    }
}
